
function myajax(act,data) {

    var post ='' ;

    Ajax.call('index.php?is_ajax=1&act=' + act, post, mycallback, 'POST', 'JSON');
}

 //ajax获取商品列表 
  
  function reloadListProduct(catid){
	 
      Ajax.call('index.php?is_ajax=1&act=allorder', 'catid=' + catid, mycallback, 'POST', 'JSON');
  }






function mycallback(result) {

    var obj = document.getElementById(result.id);
   
    if (result.status == 1) {
        obj.innerHTML = result.html;
    } else {
       // alert(result.msg);
    }
}

/* *
 * 添加商品到购物车 
 */
function n_addToCart(goodsId, parentId)
{
 
  var goods        = new Object();
  var spec_arr     = new Array();
  var fittings_arr = new Array();
  var number       = 1;
  var formBuy      = document.forms['ECS_FORMBUY'];
  var quick		   = 0;
 
  // 检查是否有商品规格 
  if (formBuy)
  {
    spec_arr = getSelectedAttributes(formBuy);

    if (formBuy.elements['number'])
    {
      number = formBuy.elements['number'].value;
    }

	quick = 1;
  }
  


  goods.quick    = quick;
  goods.spec     = spec_arr;
  goods.goods_id = goodsId;
  goods.number   = number;
  goods.parent   = (typeof(parentId) == "undefined") ? 0 : parseInt(parentId);
   
  Ajax.call('index.php?step=add_to_cart', 'goods=' + goods.toJSONString(), n_addToCartResponse, 'POST', 'JSON');
}

function n_addToCartResponse(){
	
	
}






